
import java.io.*;

public class Main {
    public static void main(String[] args)  {
        try {

			File file = new File("run.sh"); 
			file.createNewFile(); 
			file.setExecutable(true);

            BufferedWriter out = new BufferedWriter(new FileWriter(file));
            out.write("cp 1.txt 2.txt");
            out.close();
            System.out.println("OK");


			Process process = Runtime.getRuntime().exec("./run.sh");
            StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(),"Error");
            StreamGobbler outputGobbler = new StreamGobbler(process.getInputStream(),"OutPut");
            errorGobbler.start();
            outputGobbler.start();
            process.waitFor(); 

        } catch (Exception e) {
        }
    }
}
